This software is subject to the "Standard Amiga FD-Software Copyright Note". It is GIFTWARE/MAILWARE as defined in paragraph 4g/4b. For more information please read "AFD-COPYRIGHT" (Version 1.4 or higher).
Q: | The two files are equal. |
L: | The two files are different in length. |
C: | The two files have the same length, but they are different in contents. |
D: | The two files have different length and contents. |
A: | A file/directory in the directory (-tree) B does not exist in A. |
B: | A file/directory in the directory (-tree) A does not exist in B. |
W: | It was tried to compare a file with a directory (object wrong type). |
E: | Another error has occured, e.g. a read error. |
S: | A is a truncated version of B *L |
T: | B is a truncated version of A *L |
O: | File Comment mismatch *O |
P: | Protection-Bits mismatch *P |
0: | Errormessage 212: Object wrong type (A=DIR, B=FILE) *W |
1: | Errormessage 212: Object wrong type (A=FILE, B=DIR) *W |
2: | Errormessage 205: Object not found (A=DIR, B=-) *A |
3: | Errormessage 205: Object not found (A=FILE, B=-) *A |
4: | Errormessage 205: Object not found (A=-, B=DIR) *B |
5: | Errormessage 205: Object not found (A=-, B=FILE) *B |
6: | Errormessage 205: Object not found (A=NEWDIR) *N |
7: | Errormessage 205: Object not found (A=NEWFILE) *N |
8: | Errormessage 205: Object not found (B=NEWDIR) *N |
9: | Errormessage 205: Object not found (B=NEWFILE) *N |
Q: | [no text] |
L: | Difference in length |
C: | Difference in contents |
D: | Difference in length&contents |
A,B,W,E: | The corresponding error messages (see above), since workbench 2.1 localized. |
0: | All files are equal. |
5: | One or more files are different (LCDOP). |
6: | The file A is a truncated version of file B (S). |
7: | The file B is a truncated version of file A (T). |
10: | One or more files could not be found / are of wrong type (ABW). |
15: | Another error had occured (E). |
20: | A serious error occured / the comparison would be aborted. |
A/A | The first file/directory/pattern (see usage). |
B/A | The second file/directory/pattern (see usage). |
ALL/S | The two directories will be compared recursively. |
SHOW/K | Which outputs should be made or rather should be suppressed. The (to be given) parameter is a string, which contains the outputs. The outputs will be specified with the results (QLCDABWE). The meaning of the individual results is described in the part usage. A leading "~" negates the input. By default, everything will be displayed. |
ABORT/K | On which results the comparison should be aborted. The details are corresponding to the details of SHOW. By default, it will be never aborted. |
DUMP/N | Whether a hex-dump should be displayed. In case of a positive number, max.
DUMP different lines will be displayed. Equal lines will be never
displayed. In case of a negative number, all different lines will be displayed.
In case of zero, the hex-dump will be disabled. When comparing two files,
DUMP will be set to -1, by default. Otherwise to 0.
A hex-dump can be aborted with CTRL-D, but the comparison will be continued. |
CHECKD/S | If two compared files are different in length, by default they will be not checked, whether they are different in contents (up to the length difference). Besides, files will not be checked, if they are of equal date and length. With this option you can activate this feature, which mostly makes no sense and only costs time. If the DUMP option is different from 0, it will be activated automatically. |
ONLYA/S | Normally, comparing two directories, all files (directories) in the 1st tree will be compared with the 2nd and the other way. If this option is activated, only the 1st directory will be searched and compared with the 2nd. Files/directories, which are in the 2nd directory but not in the 1st one, will not be displayed/searched. |
HLINK/S | With links it is possible to build a cyclic structure, which
will be not recognized during a comparison, and will make cmp running
in a loop forever. Because of this, normally cmp will not follow hardlinks
to directories. Activating this option, it is possible to follow hardlinks to
directories.
Links to files will be checked. |
SLINK/S | Like HLINK, whether softlinks to directories should be followed. |
LFORMAT/F | This is the probably most extensive option of cmp. With it, the look of the output can be changed. But not the look of the hex-dump. How it exactly works, you can read on the following page. |
NOSTAT/S | Switches off the statistics. |
NORC/S | If this option is enabled the resultcode is always 0, except of serious errors or user abort.
This option is intended for the usage of cmp in DOpus and ARexx scripts, because there may occur problems or undesired effects with a non-zero return code. |
DETAIL/S | With this option the results ABLW will be more detailed.
The new results for L: (And their also new RC-Codes.) S: A is a truncated version of B T: B is a truncated version of A The new results for W: 0: Errormessage 212: Object wrong type (A=DIR, B=FILE) 1: Errormessage 212: Object wrong type (A=FILE, B=DIR) The new results for AB: 2: Errormessage 205: Object not found (A=DIR, B=-) 3: Errormessage 205: Object not found (A=FILE, B=-) 4: Errormessage 205: Object not found (A=-, B=DIR) 5: Errormessage 205: Object not found (A=-, B=FILE) |
NEWDIR/N | Also directory structures, which doesn't exists in the other tree will be displayed.
You have to specify a maximal depth. A depth of <= 0 will mean unlimited!
This option is only useful together with ALL.
There are new results (68) for this Option. ( see output
)
An example for this option can be found here . |
NEWFILE/S | Displays also the files in the directories, added by NEWDIR.
There are new results (79) for this Option. ( see Output ) An example for this option can be found here . |
REVADIR/S,REVBDIR/S | With the options NEWDIR and NEWFILE
normally the new directory will be displayed first, and then it's contents. With this option you can
reverse it.
An example for this option can be found here . |
DUMPALL/S | All lines - not only different - will be displayed. |
SKIPFIRSTNBYTES=SKIP/K/N | The first N bytes of each file will be skipped. You'll receive an result L if the file is too short. |
COMMENT=COM/K/N |
If COM is 1 or -1 the comparison is case insensitive, else it's case sensitive. In case of a mismatch the result O will be returned. |
PROTBITS/S | If switched on, protection bits mismatches are displayed. |
%n | Name |
%p | Path (QLCD: relative to base, ABWE: absolute) |
%t | Path (QLCD: relative to base, ABWE: with a leading "A:"/"B:") |
%P | Path + Name (see %p) |
%T | Path + Name (see %t) |
%e | Error as text |
%E | Error as number |
%r | Result (QLCDABWE) |
%R | Path relative to base |
%a | Absolute path in A |
%b | Absolute path in B |
%% | "%" |
*n, *N | A new line will be inserted |
*e, *E | An ESC character will be inserted |
** | "*" |
Q: | 700 | "" |
L: | 701 | "Difference in length" |
C: | 702 | "Difference in contents" |
D: | 703 | "Difference in length&contents" |
A: | 704 | Errormessage 205: Object not found |
B: | 705 | Errormessage 205: Object not found |
S: | 706 | "A is a truncated version of B" |
T: | 707 | "B is a truncated version of A" |
O: | 708 | "Difference in comment" |
P: | 709 | "Difference in protection bits" |
W: | 212 | Errormessage 212: Object wrong type |
E: | xxx | Errormessage xxx |
0: | 800 | Errormessage 212: Object wrong type (A=DIR, B=FILE) |
1: | 801 | Errormessage 212: Object wrong type (A=FILE, B=DIR) |
2: | 802 | Errormessage 205: Object not found (A=DIR, B=-) |
3: | 803 | Errormessage 205: Object not found (A=FILE, B=-) |
4: | 804 | Errormessage 205: Object not found (A=-, B=DIR) |
5: | 805 | Errormessage 205: Object not found (A=-, B=FILE) |
6: | 806 | Errormessage 205: Object not found (A=NEWDIR) |
7: | 807 | Errormessage 205: Object not found (A=NEWFILE) |
8: | 808 | Errormessage 205: Object not found (B=NEWDIR) |
9: | 809 | Errormessage 205: Object not found (B=NEWFILE) |
2.0 | 2000-11-26 |
|
1.9 | 2000-10-08 |
|
1.8 | 2000-02-11 |
|
1.7 | 2000-01-25 |
|
1.6 | -internal- |
|
1.5 | 1999-04-07 |
|
1.4 | 1997-05-21 |
|
1.3 | 1997-04-16 |
|
1.2 | 1997-04-10 |
|
1.1 | 1997-02-28 |
|
1.0 | 1997-02-18 |
|
DUMP: Disk.info Test.info 0010: 00000002 00000A40 .......@ 00000002 0000099B ........ 0018: 00000CBF 00000106 ...¿.... 000001B6 00000017 ...¶.... 0020: 000003E9 00000A40 ...é...@ 000003E9 0000099B ...é.... 0028: 2C780004 2A4F226E ,x..*O"n 48E77EFE 24482400 Hç~þ$H$. 0030: 01144AA9 00AC6652 ..J©.¬fR 49F90000 00002C78 Iù....,x 0038: 41E9005C 2F084EAE Aé.\/.N® 000447F9 000005AC ..Gù...¬ Disk.info: Found 31 differences in contents&length until abort
/* ** Update only all neccesary files from dir A -> dir B ** ©1999/2000 ALeX Kazik */ /* IMPORTANT: the src/dst dir MUST end with a colon or slash and MUST NOT be empty! */ /* SOURCE directory */ src = 'a/' /* DESTINATION directory */ dst = 'b/' /* the script to create, and which will be executed */ script = 'T:script' /* SKIP the first N bytes */ skip = 0 /* temporary file */ tmpfile = 'T:update.tmp' /* ** The main-program */ ADDRESS COMMAND cmp 'A="' || src || '" B="' || dst || '" all nostat norc skipfirstnbytes=' || SKIP , || ' newdir=10 newfile revbdir detail lformat %r%R%n >"' || TMPFILE || '"' IF RC >= 20 THEN DO SAY 'Error while executing cmp' EXIT RC END CALL OPEN(tmp, tmpfile, 'read') CALL OPEN(scr, script, 'write') eq = 0 DO UNTIL EOF(tmp) act = READCH(tmp, 1) file = READLN(tmp) IF act = '' THEN BREAK ELSE IF act = 'Q' THEN eq = eq + 1 ELSE IF (act = 'A') | (act = '5') | (act = '9') THEN DO SAY 'File to remove: ' || file CALL WRITELN(scr, 'delete "' || dst || file || '" quiet') END ELSE IF (act = '4') | (act = '8') THEN DO SAY 'Dir to remove: ' || file CALL WRITELN(scr, 'delete "' || dst || file || '" quiet') END ELSE IF (act = 'B') | (act = '3') | (act = '7') THEN DO SAY 'New File: ' || file CALL WRITELN(scr, 'copy "' || src || file || '" "' || dst || file || '"') END ELSE IF (act = '2') | (act = '6') THEN DO SAY 'New Dir: ' || file CALL WRITELN(scr, 'makedir "' || dst || file || '"') END ELSE IF (act = 'E') | (act = '0') | (act = '1') THEN DO SAY 'Error/Warning at dir/file: ' || file EXIT 20 END ELSE IF (act = 'L') | (act = 'C') | (act = 'D') | (act = 'S') | (act = 'T') THEN DO SAY 'File to Update: ' || file CALL WRITELN(scr, 'copy "' || src || file || '" "' || dst || file || '"') END ELSE DO SAY 'Unknown Symbol >' || act || '<' CALL CLOSE(tmp) CALL CLOSE(scr) EXIT 20 END END SAY eq || ' Equal files.' CALL CLOSE(tmp) CALL CLOSE(scr) /* ** executing the changes */ execute '"' || script || '"' /* ** That's all. */